﻿// Copyright (C) Jari Hautio <jari.hautio@iki.fi> 2008. Licensed under GPLv2. See LICENSE.txt in solution folder.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RyijyApp
{
    public partial class GalleryForm : Form
    {
        public GalleryForm()
        {
            InitializeComponent();
        }
        public void AddImage(Image img, string descr)
        {
            PictureBox pb = new PictureBox();
            pb.Image = img;
            pb.Size = new Size(200, 200);
            pb.SizeMode = PictureBoxSizeMode.Zoom;
            flowLayoutPanel1.Controls.Add(pb);
            toolTip1.SetToolTip(pb, descr);
            pb.Click += new EventHandler(pb_Click);
        }

        void pb_Click(object sender, EventArgs e)
        {
            PictureBox pb =  sender as PictureBox;
            if (pb == null) return;
            if (pb.Width > 200)
                pb.Size = new Size(200, 200);
            else pb.Size = new Size(400, 400);
        }
    }
}
